Page({
  data: {
    list: [],
    current: 0,
    flag: false,
  },
  baoxiu(e) {
    let id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: '/pages/ewm/ewm?id=' + id
    })
  },
  onReachBottom() {
    if (this.data.flag) return
    this.getlist()
  },
  async onLoad() {
    this.getlist()
  },
  async getlist() {
    this.setData({
      flag: true,
      current: this.data.current + 1
    })
    let res = await wx.http.get('/visitor', {
      current: this.data.current,
      pageSize: '10'
    })
    let arr = this.data.list
    res.data.rows.forEach(item => {
      arr.push(item)
    });
    this.setData({
      list: arr,
      flag: false
    })
    console.log(arr)
  },
  onReady() {

  },
  onShow() {

  },
  onHide() {

  },
  onUnload() {

  },
  onPullDownRefresh() {

  },
  onShareAppMessage() {

  }
})